package com.chen.spring.cloud.service.admin.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chen.entity.System;
import com.chen.spring.cloud.service.admin.mapper.ZsSystemMapper;
import com.chen.spring.cloud.service.admin.service.IZsSystemService;
import com.chen.vo.ServiceTelVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 系统设置 服务实现类
 * </p>
 *
 * @author 陈永鹏
 * @since 2019-03-25
 */
@Service
public class ZsSystemServiceImpl extends ServiceImpl<ZsSystemMapper, System> implements IZsSystemService {

    @Autowired
    private ZsSystemMapper zsSystemMapper;

    @Override
    public List<ServiceTelVo> getServiceTel() {
        List<ServiceTelVo> result = new ArrayList<>();
        System zsSystem = zsSystemMapper.selectOne(null);
        if (zsSystem != null){
            result.add(new ServiceTelVo(zsSystem.getService_tel_text1(),zsSystem.getService_tel1()));
            result.add(new ServiceTelVo(zsSystem.getService_tel_text2(),zsSystem.getService_tel2()));
        }

        return result;
    }
}
